using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerWallSlideState : PlayerTouchingWallState
{
    public PlayerWallSlideState(Player player, PlayerMoveData playerData, StateMachine stateMachine, string animBoolName) : base(player, playerData, stateMachine, animBoolName)
    {
    }

    public override void LogicUpdate()
    {
        base.LogicUpdate();

        player.SetVelocityY(playerData.wallSlideVelocity * -1);

        if (grabInput)
        {
            if (yInput == 1)
            {
                stateMachine.ChangeState(player.WallClimbState);
            }
            else if (yInput == 0)
            {
                stateMachine.ChangeState(player.WallGrabState);
            }
        }
        else if (jumpInput) 
        {
            stateMachine.ChangeState(player.WallNegativeJumpState);
        }
    }
}
